package com.google.code.jskills.dal.entities;

// Generated 25.06.2013 17:52:09 by Hibernate Tools 3.6.0

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;


/**
 * UserVerificationEntity generated by hbm2java
 */
@Entity
@Table(name = "USER_VERIFICATION", schema = "PUBLIC", catalog = "PUBLIC", uniqueConstraints = {
                @UniqueConstraint(columnNames = "VERIFICATION_INFO") })
public class UserVerificationEntity implements java.io.Serializable {

        private Integer id;
        private UserEntity userEntity;
        private Date initiatedOn;
        private Date validTo;
        private String verificationInfo;
        private int attemptsCount;

        public UserVerificationEntity() {
        }

        public UserVerificationEntity(UserEntity userEntity,
                        String verificationInfo, int attemptsCount) {
                this.userEntity = userEntity;
                this.verificationInfo = verificationInfo;
                this.attemptsCount = attemptsCount;
        }

        public UserVerificationEntity(Date initiatedOn,
                        Date validTo, String verificationInfo, int attemptsCount) {
                this.initiatedOn = initiatedOn;
                this.validTo = validTo;
                this.verificationInfo = verificationInfo;
                this.attemptsCount = attemptsCount;
        }

        @Id
        @GeneratedValue(strategy = IDENTITY)
        @Column(name = "ID", unique = true, nullable = false)
        public Integer getId() {
                return this.id;
        }

        public void setId(Integer id) {
                this.id = id;
        }

        @OneToOne
        @JoinColumn(name="user_id", nullable = false)
        public UserEntity getUserEntity() {
                return this.userEntity;
        }

        public void setUserEntity(UserEntity userEntity) {
                this.userEntity = userEntity;
        }

        @Temporal(TemporalType.TIMESTAMP)
        @Column(name = "INITIATED_ON", length = 26)
        public Date getInitiatedOn() {
                return this.initiatedOn;
        }

        public void setInitiatedOn(Date initiatedOn) {
                this.initiatedOn = initiatedOn;
        }

        @Temporal(TemporalType.TIMESTAMP)
        @Column(name = "VALID_TO", length = 26)
        public Date getValidTo() {
                return this.validTo;
        }

        public void setValidTo(Date validTo) {
                this.validTo = validTo;
        }

        @Column(name = "VERIFICATION_INFO", unique = true, nullable = false, length = 4096)
        public String getVerificationInfo() {
                return this.verificationInfo;
        }

        public void setVerificationInfo(String verificationInfo) {
                this.verificationInfo = verificationInfo;
        }

        @Column(name = "ATTEMPTS_COUNT", nullable = false)
        public int getAttemptsCount() {
                return this.attemptsCount;
        }

        public void setAttemptsCount(int attemptsCount) {
                this.attemptsCount = attemptsCount;
        }

}
